<html>

<head>
<script type="text/javascript">
function upperCase()
{
console.log("asus")
var x="fname"
var y=document.getElementById(x).value
document.getElementById(x).value=y.toUpperCase()
}
</script>
</head>

<body>

Enter your name: <input type="text" id="fname" >

<script type="text/javascript">
window.onload=function (){

console.log("asusaa")
document.getElementById("fname").addEventListener("change",upperCase,false);

}
</script>
</body>
</html>
